package com.mlatent.mvvmproject.app.weight.glide

import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestOptions

object GlideUtil {

    /**
     * 设置图片圆角
     */
    fun roundImage(radius: Int): RequestOptions {
        //设置图片圆角角度
        val roundedCorners = RoundedCorners(radius)
        //通过RequestOptions扩展功能,override:采样率,因为ImageView就这么大,可以压缩图片,降低内存消耗
        return RequestOptions.bitmapTransform(roundedCorners)
    }
}